using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MSRI.HelperClasses;
using Instedd.Labs.Geo.Library.Kml;
using Mvp.Xml.Common.Xsl;
using System.Xml;
using System.IO;
using System.Xml.Xsl;
using System.Collections.Specialized;
using Instedd.Labs.Geo.Library.Sms;

namespace Instedd.Labs.Geo.Library.Tests.Managers
{
    /// <summary>
    /// Summary description for UnitTest1
    /// </summary>
    [TestClass]
    public class FileNamesGeneratorFixture
    {
        public FileNamesGeneratorFixture()
        {
        }

        [TestMethod]
        public void GenerateKmlFileNameReturnsSmsFileNameAppendedToConfiguredKmlOutput()
        {
            Configuration configuration = new Configuration();
            configuration.KmlOutput = @"c:\kmloutput";

            string kmlFileName = FileNamesGenerator.GenerateKmlFileName(configuration);

            Assert.AreEqual(@"c:\kmloutput\SMSchat.kml", kmlFileName);
        }

        [TestMethod]
        public void GenerateKmlFileNameForSharingReturnsSmsChatKmlFileNameAppendedToConfiguredKmlOutput()
        {
            Configuration configuration = new Configuration();
            configuration.KmlOutput = @"c:\kmloutput";

            string kmlFileName = FileNamesGenerator.GenerateKmlFileNameForSharing(configuration);

            Assert.AreEqual(@"c:\kmloutput\SMSchatForSharing.kml", kmlFileName);
        }

        [TestMethod]
        public void GenerateRssFileNameReturnsSmsRssFileNameAppendedToConfiguredKmlOutput()
        {
            Configuration configuration = new Configuration();
            configuration.RssOutput = @"c:\rssoutput";

            string kmlFileName = FileNamesGenerator.GenerateRssFileName(configuration);

            Assert.AreEqual(@"c:\rssoutput\SMSchat.rss", kmlFileName);
        }

        [TestMethod]
        public void GenerateRssFileNameForSharingReturnsSmsRssFileNameAppendedToConfiguredKmlOutput()
        {
            Configuration configuration = new Configuration();
            configuration.RssOutput = @"c:\rssoutput";

            string kmlFileName = FileNamesGenerator.GenerateRssFileNameForSharing(configuration);

            Assert.AreEqual(@"c:\rssoutput\SMSchatForSharing.rss", kmlFileName);
        }

        [TestMethod]
        public void GenerateRssFileNameByUserReturnsUserRssFileNameAppendedToConfiguredKmlOutput()
        {
            Configuration configuration = new Configuration();
            configuration.RssOutput = @"c:\rssoutput";

            string kmlFileName = FileNamesGenerator.GenerateRssFileName(configuration, "userNameValue");

            Assert.AreEqual(@"c:\rssoutput\SMSchat.userNameValue.rss", kmlFileName);
        }
    }
}